package cn.cvs.service.impl;

import cn.cvs.dao.StorageRecordMapper;
import cn.cvs.pojo.StorageRecord;
import cn.cvs.service.StorageRecordService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("storageRecordService")
public class StorageRecordServiceImpl implements StorageRecordService {
    @Resource
    private StorageRecordMapper storageRecordMapper;
    @Override
    public int addStorageRecord(StorageRecord storageRecord) {
        return storageRecordMapper.addStorageRecord(storageRecord);
    }

    @Override
    public int delStorageRecord(Integer id) {
        return storageRecordMapper.delStorageRecord(id);
    }

    @Override
    public int updStorageRecord(StorageRecord storageRecord) {
        return storageRecordMapper.updStorageRecord(storageRecord);
    }

    @Override
    public int getStorageRecordBySupplierId(Integer supplierId) {
        return storageRecordMapper.getStorageRecordBySupplierId(supplierId);
    }

    @Override
    public int getStorageRecordByIf(Integer id, Integer pay, String name) {
        return storageRecordMapper.getStorageRecordByIf(id, pay, name);
    }

    @Override
    public List<StorageRecord> getListByPage(Integer id, Integer pay, String name, Integer pageIndex, Integer pageSize) {
        return storageRecordMapper.getListByPage(id, pay, name, (pageIndex-1)*pageSize, pageSize);
    }

    @Override
    public StorageRecord getStorageById(Integer storageId) {
        return storageRecordMapper.getStorageById(storageId);
    }
}
